package com.onlineclass.backstagemanagement.controller;

import com.onlineclass.backstagemanagement.feign.CourseFeign;
import com.onlineclassbackstage.beans.ResultObject;
import com.onlineclassbackstage.beans.User;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpSession;

@RestController
@RequestMapping("/teacher")
public class TeacherController {

     @Autowired
     CourseFeign feign;

    @RequestMapping("/selectCoursesByTeacher")
    public ResultObject selectCoursesByTeacher(HttpSession session){
        User user = (User) session.getAttribute("user");
        return feign.selectCourseByTeacher();
    }


}
